import { IParams } from "@/utils/login"
import { request } from "umi"
export let loginUser = (name: string, password: string) => {
    //获取登录态
    return request("api/auth/login",
        {
            method: 'POST',
            data: {
                name: name,
                password: password
            }
        })
}

export let loginAdmin = (params: IParams) => {
    //获取登录态

    return request("api/auth/admin",
        {
            method: 'POST',
            params
        })
}

//注册账号
export let RegistryUser = (name: string, password: string, confirm: string) => {
    //获取登录态
    return request("api/user/register",
        {
            method: 'POST',
            data: {
                name: name,
                password: password,
                confirm: confirm
            }
        })
}